<!--
 * @Description: 
 * @Autor: Zhongyu
 * @Date: 2021-03-16 16:02:51
 * @LastEditors: Zhongyu
 * @LastEditTime: 2021-03-16 16:33:47
-->

<template>
	<div id="z-breadcrumb" class="z-breadcrumb">
		<el-breadcrumb separator-class="el-icon-d-arrow-right">
			<el-breadcrumb-item replace :to="{ path: '/' }">
				<i class="el-icon-s-home"></i>
				首页
			</el-breadcrumb-item>
			<template v-for="(item, i) in datas">
				<el-breadcrumb-item
					replace
					:key="i"
					v-if="item.path != ''"
					:to="{ path: item.path }"
				>
					{{ item.title }}
				</el-breadcrumb-item>
				<el-breadcrumb-item :key="i" replace v-else>
					{{ item.title }}
				</el-breadcrumb-item>
			</template>
		</el-breadcrumb>
	</div>
</template>

<script>
export default {
	name: 'z-breadcrumb',
	props: {
		datas: {
			type: Array,
			default: () => {
				return [];
			},
		},
		defaultActive: [String, Number],
	},
};
</script>
<style lang="less" src="./index.less"></style>
